/*
package com.wuchao.servlet143;

import com.wuchao.entity.Pojo;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

*/
/**
 * @author 吴超66
 * @version 1.0
 * @date 2022/4/24 16:16
 *//*

@WebFilter(filterName = "FilterInterractor",urlPatterns = "/demo71/*")
public class FilterInterractor implements Filter {
    public void destroy() {
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        HttpSession session = ((HttpServletRequest) req).getSession();
       Pojo pojo =(Pojo) session.getAttribute("pojo");
       if(pojo==null){
           ((HttpServletResponse)resp).sendRedirect((
                   (HttpServletRequest) req).getContextPath()+"/demo71/page.jsp?feifa=fa");
       }
        chain.doFilter(req, resp);
    }

    public void init(FilterConfig config) throws ServletException {

    }

}
*/
